<?php
namespace app\common\model;

use think\Model;

class CouponLogs extends Model
{
	public function Coupons()
    {
        return $this->hasOne('Coupons', 'id', 'coupon_id')->where("use_end_time",">",time())->field("id,name,money,min_amount,use_start_time,use_end_time");
    }

    public function useCoupons()
    {
        return $this->hasOne('Coupons', 'id', 'coupon_id')->where("use_end_time",">",time())->where("use_start_time",'<',time())->field("id,uid,name,money,min_amount,use_start_time,use_end_time");
    }
}